package com.study.talk.data.model;


import com.study.talk.data.model.vo.MomentVo;
import com.study.common.annotation.Desc;
import com.study.common.GSONUtil;


@Desc(value = "Moment对象")
public class Moment {

    @Desc("动态id")
    private Integer id;

    @Desc("发布者id")
    private Integer userId;

    @Desc("发布者图片")
    private String avatar;

    @Desc("发布者名称")
    private String userName;

    @Desc("动态图片")
    private String photos;

    @Desc("动态内容")
    private String content;

    @Desc("点赞数")
    private Integer likeCount;

    @Desc("创建时间")
    private String createTime;

    public Moment() {
    }

    public Moment(MomentVo momentVo) {
        this.userId = momentVo.getUserId();
        this.avatar = momentVo.getAvatar();
        this.userName = momentVo.getUserName();
        this.photos = GSONUtil.INSTANCE.toJson(momentVo.getPhotos());
        this.content = momentVo.getContent();
        this.likeCount = 0;
    }

    public Moment(Integer id, Integer userId, String avatar, String userName, String photos, String content, Integer likeCount, String createTime) {
        this.id = id;
        this.userId = userId;
        this.avatar = avatar;
        this.userName = userName;
        this.photos = photos;
        this.content = content;
        this.likeCount = likeCount;
        this.createTime = createTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhotos() {
        return photos;
    }

    public void setPhotos(String photos) {
        this.photos = photos;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
